import java.util.*;
public class Main
{
    private static Scanner in;
    public static void main(String[] args)
    {
        in=new Scanner(System.in);
        double a,b=0;
        for(int i=0;i<8;i++)
        {
            a=in.nextDouble();
            q(a,b);
        }

    }
    private static void q(double a,double b)
    {

        if(a<0)
        {
            System.out.println("NaN");
        }
        else
        {
            for(;a-b*b>0.0001;b=b+0.0001)
            {
            }
            System.out.printf("%.6f\n",b);
        }
    }
}
